//
//  TestCell.m
//  Test
//
//  Created by 红沙尘 on 17/6/8.
//  Copyright © 2017年 红沙尘. All rights reserved.
//

#import "TestCell.h"
#import "SelectView.h"

@interface TestCell ()

@property (nonatomic, strong) NSDictionary *dataDict;

@end

@implementation TestCell
{
    __weak IBOutlet SelectView *selectedView;
    
}

- (void)dealloc {
    NSLog(@"%s",__FUNCTION__);
    [selectedView removeSelectStateChangeObserver];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    selectedView.normalImage = [UIImage imageNamed:@"normal"];
    selectedView.selectedImage = [UIImage imageNamed:@"selected"];
}

- (void)loadWithDict:(NSDictionary *)dict {
    
    self.dataDict = dict;
    
    [selectedView addSelectStateChangeObserver:dict];
}

- (void)updateSelectedState {
    [selectedView updateSelectedWithData:self.dataDict];
}

@end
